<?php
require_once FOREGROUND_COMMON_ACTION_SERVICE_DIR . '/default.php';

class foreground_cart_index_action_service extends foreground_default_common_action_service
{
    protected static $_instance;

    public static function get_instance()
    {
        if (null === self::$_instance) {
            self::$_instance = new self();
        }

        return self::$_instance;
    }


    protected function _current_page_process()
    {
        //var_dump(__METHOD__); exit();
        
        $action_data = wwy_action::$data;
        $session_member_info = $action_data['session_member_info'];
        $member_id = $session_member_info['id'];
        
        $model_foreground_cart = wwy_resource_container::get_model_foreground_cart();
        //var_dump($model_foreground_cart); exit();        
        
        $cart_list_info = $model_foreground_cart->get_cart_list_info($member_id);
        //var_dump($cart_list_info); exit();
        self::add_view_data('cart_list_info', $cart_list_info);
        
        //SEO:title,keywords,description
        self::add_view_data('page_title', '购物车');
    }
}